package se.webbzon.oschi01.nbt;

import se.webbzon.oschi01.nbt.TagEvent.Action;

public class ShortTag extends AbstractTag<Short> {
	
	private short s;
	
	public ShortTag(TagFactory<Short> factory, String tagName, short s) {
		super(factory, tagName);
		this.s = s;
	}

	@Override public long size() {
		return 2;
	}

	@Override public Short getValue() {
		return s;
	}

	@Override public void setValue(Short value) {
		this.s = value;
		broadcastEvent(new TagEvent(this,Action.CHANGED,value));
	}

	@Override public Class<Short> getValueClass() {
		return Short.class;
	}

	@Override public AbstractTag<Short> clone() {
		return new ShortTag(getFactory(),this.toString(),s);
	}

}
